package com.gwl.circle.common.vo;

import com.gwl.circle.common.config.SystemConfig;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @Author 高万里
 */
@Data
@AllArgsConstructor
public class R {

    private Integer code;
    private String msg;
    private Object data;

    private R(){}

    public static R ok(Object data) {
        return new R(SystemConfig.R_OK, "ok", data);
    }

    public static R ok() {
        return ok(null);
    }

    public static R fail(String msg) {
        return new R(SystemConfig.R_FAIL, msg, null);
    }

    public static R fail(){
        return fail(null);
    }
}
